package top.goldenyear.porpoise.framework.security.core.service.provider;

import cn.dev33.satoken.stp.StpInterface;
import top.goldenyear.porpoise.framework.security.core.service.IPermissionService;
import java.util.List;
import org.noear.solon.annotation.Component;
import org.noear.solon.annotation.Inject;

/**
 * 注入bean对象时，不会注册继承的接口类，所以单独出来，然后调用 context.getBeanAsync(StpInterface.class, bean -> {
 * SaManager.setStpInterface(bean); });
 *
 * @author airhead
 */
@Component
public class StpServiceProvider implements StpInterface {
  @Inject private IPermissionService permissionService;

  @Override
  public List<String> getPermissionList(Object loginId, String loginType) {
    return permissionService.getPermissionList(loginId, loginType);
  }

  @Override
  public List<String> getRoleList(Object loginId, String loginType) {
    return permissionService.getRoleList(loginId, loginType);
  }
}
